def getMenuOption(debug = False):
	if debug:
		print "getMenuOption Function"
	validInput = False
	while not validInput:
		option = raw_input("> ")
		if (option.lower() == "1" or
			option.lower() == "story 1" or
			option.lower() == "one" or
			option.lower() == "story one" or
			option.lower() == "journey" or
			option.lower() == "a journey"):
			validInput = True
		elif (option.lower() == "2" or
			  option.lower() == "story 2" or
			  option.lower() == "two" or
			  option.lower() == "story two" or
			  option.lower() == "hunters"):
			validInput = True
		elif (option.lower() == "3" or
			  option.lower() == "story 3" or
			  option.lower() == "three" or
			  option.lower() == "story three" or
			  option.lower() == "poem" or
			  option.lower() == "a poem"):
	 		validInput = True
		elif (option.lower() == "exit" or
		      option.lower() == "e" or
		      option.lower() == "x" or
		      option.lower() == "quit" or
		      option.lower() == "q"):
				  validInput = True
				  option = "exit"
		else:
			print "Please type one of the available options"
	return option
		
def getWord(prompt, debug = False):
	if debug:
		print "getWord Function", prompt
	validInput = False
	while not validInput:
		option = raw_input(prompt)	
		validInput = True
		if option == "":
			print "Please type a word"
			validInput = False
		elif isSwear(option, debug):
			print "That is quite rude, don't say that."
			validInput = False
	return option

def getNumber(prompt, debug = False):
	if debug:
		print "getWord Function", prompt
	validInput = False
	numbers = "0123456789."
	while not validInput:
		option = raw_input(prompt)	
		validInput = True
		for character in option:
			if not(character in numbers):
				validInput = False
		if not validInput:
			print "I know you know what a number is, type a number."
	return option
		
		
def isSwear(word, debug = False):
	if debug:
		print "isSwear Function", word
	swears = ["poop",
			  "dodo head",
			  "pee",
			  "shit"]
	if word.lower() in swears:
		return True
	else:
		return False
		
def getDay(prompt, debug = False):
	if debug:
		print "getWord Function", prompt
	days = ["monday",
			"tuesday",
			"wednesday",
			"thursday",
			"friday",
			"saturday",
			"sunday"]
	days = False
	while not days:
		option = raw_input(prompt)	
		if prompt.lower() in days:
			days =  True
		else:
			return False
	if not days:
		print "That's not a day!"
	return option
